<!DOCTYPE html>
<head>
	<link type="text/css" rel="stylesheet" href="/css/main.css" />
    <link rel="stylesheet" href="/css/demo.css" type="text/css" media="screen">
    <link rel="stylesheet" href="/css/demo-print.css" type="text/css" media="print">
    
    <script src="/js/raphael.js"></script>
    <script src="/js/popup.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="/js/analytics.js"></script>
    <style type="text/css" media="screen">
        #holder {
            height: 250px;x 
            margin: -525px 0 0 -400px;
            width: 800px;
        }
    </style>
</head>
{% autoescape true %}
<html>
  <body>

    <div style='float:left;width:100%;'>
      <div style="float:left;width:100%;">
        <div style="float:left;"><h2 style="margin-left: 40px;">Kooddle</h2></div>
        <div style="float:right;">{% if currentUser %}Hi,{{currentUser.nickname()}}{% endif %} <a href="{{ url|safe }}">{{ url_linktext }}</a></div>
      </div>
    <div style="float:left;width:100%;"><hr></div>
    </div>

    <div style='float:left;width:100%;'>
    <div style="float:left;display:inline-block;">Current: <a href="/graph" >All Graphs</a> > {{ graph.title }}</div>
    
    {% if allowWrite %}
    <div style="float:right;display:inline-block;">
      <div style="float:left;">
        <form action="/graph/{{ graph.key.id() }}" method="post">
            <div><input name="entry_value" /><input type="submit" value="add data"></div>      
        </form>
      </div>
    </div> 
    {% endif %}
    <div style='float:left;width:100%;'><hr></div>
    <div style='float:left;font-size:14px;'>({{graph.url}}, "{{graph.regexp}}", {{graph.frequency}})</div>
    {% if allowWrite %}
    <div style='float:left;font-size:14px;'><a href="/graph/{{ graph.key.id() }}/edit"><img src='/images/edit-pencil.png' width="18" height="18"/></a></div>
    {% endif %}
    </div>

    <div style="float:left:width:100%" id="holder"></div>    
    <div style="float:left:width:100%">
    <table id="data">
        <tfoot>
            <tr>
            {% for entry in entries %}
                <th>{{entry.date.strftime('%Y/%m/%d %H:%M:%S')}}</th>
            {% endfor %}
            </tr>
        </tfoot>
        <tbody>
            <tr>
             {% for entry in entries %}
                <td>{{ entry.value }}</td>
            {% endfor %}
            </tr>
        </tbody>
    </table>  
    </div>
  </body>
</html>
{% endautoescape %}